<?php
declare (strict_types=1);

namespace app\course\service\live;

use app\common\service\BaseService;
use app\course\logic\live\LiveBoke;
use think\annotation\Inject;
use think\facade\Request;

/**
 * CC直播接口类
 * Author 亓官雨树<lucky.max@foxmail.com>
 * Date：   2021-10-27
 */
class LiveBokeCC extends BaseService
{
    /**
     * @Inject()
     * @var LiveBoke
     */
    protected $boke;
    
    /**
     * 创建大班课直播间
     */
    public function createZBRoom()
    {
        $param = Request::post();
        $data  = $this->boke->createZBRoom($param);

        return $this->parseToData($data, 1, '创建成功');
    }

    /**
     * 创建小班课直播间
     */
    public function createKTRoom()
    {
        $param = Request::post();
        $data  = $this->boke->createKTRoom($param);

        return $this->parseToData($data, 1, '创建成功');
    }
    
    /**
     * 小班课自动登录链接
     */
    public function autoUri()
    {
        $param = Request::post();
        $data = $this->boke->autoUri($param);

        return $this->parseToData($data, 1, '创建成功');
    }

    /**
     * 获取小班课回放链接
     */
    public function getKTRecordUrl()
    {
        $recordid = Request::get('recordid/s');
        $data = $this->boke->getKTRecordUrl($recordid);

        return $this->parseToData($data, 1, '获取成功');
    }

    /**
     * 获取小班课回放链接
     */
    public function getKTFullRecordUrl()
    {
        $param = Request::get();
        $data = $this->boke->getKTFullRecordUrl($param);

        return $this->parseToData($data, 1, '获取成功');
    }

}
